package com.changgou.oauth.exception;


import com.changgou.entity.ResultCode;

/**
 * @param
 * @author 大佬味的小男孩
 * @return
 * @description: 自定义异常处理类
 * @date 2020/07/17 10:15
 */
public class MyBaseException extends RuntimeException {

    private Integer code; //状态码
    private String message; // 消息体
    private ResultCode resultCode; //封装一个异常的信息

    public MyBaseException(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public MyBaseException(ResultCode resultCode) {
        this.resultCode = resultCode;
    }

    public ResultCode getResultCode() {
        return resultCode;
    }

    public static MyBaseException throwe(ResultCode resultCode) {
        throw new MyBaseException(resultCode);
    }
}
